//  引入项目中全部的全局组件
import SvgIcon from "./SvgIcon/index.vue";
//  引入element所有图标
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
//  引入项目中弹框头
import BoxHeader from "./BoxHeader/index.vue";
//  引入label样式
import ColumnLabel from "./ColumnLabel/index.vue";

const allGloablComponent: any = {
  SvgIcon,
  BoxHeader,
  ColumnLabel,
};

//  对外暴露组件
export default {
  //  务必叫做install方法
  install(app: { component: (arg0: string, arg1: any) => void }) {
    //  注册项目全部的全局组件
    Object.keys(allGloablComponent).forEach((key) => {
      app.component(key, allGloablComponent[key]);
    });

    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component);
    }
  },
};
